package com.googlecode.dgwt.client.dojo.impl;

import com.google.gwt.dom.client.Node;
import com.googlecode.dgwt.client.dojo.core.JsMap;


/**
 * @author      Wellington Tadeu dos Santos
 * @since       DGWT v0.01
 */
public class DojoImpl_WebKit extends DojoImpl {

    
    /**
     * (non-Javadoc)
     * @see com.googlecode.dgwt.client.dojo.impl.DojoImpl#getComputedStyle(Node)
     */
    @Override
    public native <V extends Object> JsMap<V> getComputedStyle(Node node) /*-{
        var s;
        if(node.nodeType == @com.google.gwt.dom.client.Node::ELEMENT_NODE){
            var dv = node.ownerDocument.defaultView;
            s = dv.getComputedStyle(node, null);
            if(!s && node.style){
                node.style.display = ""; 
                s = dv.getComputedStyle(node, null);
            }
        }
        return s || @com.googlecode.dgwt.client.dojo.core.JsObject::EMPTY_OBJECT;
    }-*/;

}
